package x.java.tea;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapInjector extends ObjectInjector implements Map<String, Object> {
	private Map<String, Object> map;

	public MapInjector() {
		this.map = new HashMap<String, Object>();
	}

	public MapInjector(Map<? extends String, ? extends Object> m) {
		this.map = new HashMap<String, Object>(m);
	}

	public void setMap(Map<String, Object> map) {
		this.map = map;
	}

	public void init(String id) {
		this.obj = map.get(id);
		super.init(id);
	}

	public void clear() {
		map.clear();
	}

	public boolean containsKey(Object key) {
		return map.containsKey(key);
	}

	public boolean containsValue(Object value) {
		return map.containsValue(value);
	}

	public boolean equals(Object o) {
		return map.equals(o);
	}

	public int hashCode() {
		return map.hashCode();
	}

	public boolean isEmpty() {
		return map.isEmpty();
	}

	public Set<String> keySet() {
		return map.keySet();
	}

	public int size() {
		return map.size();
	}

	public Object put(String key, Object value) {
		return map.put(key, value);
	}

	public void putAll(Map<? extends String, ? extends Object> m) {
		map.putAll(m);
	}

	public Set<java.util.Map.Entry<String, Object>> entrySet() {
		return map.entrySet();
	}

	public Object get(Object key) {
		return map.get(key);
	}

	public Object remove(Object key) {
		return map.remove(key);
	}

	public Collection<Object> values() {
		return map.values();
	}
}
